package com.bdqn.jd.service;

import com.bdqn.sj.mapper.SysUserMapper;
import com.bdqn.sj.pojo.SysRole;
import com.bdqn.sj.pojo.SysUser;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * SysUserService服务层实现类
 */
@Transactional
@Service("sysUserService")
public class SysUserServiceImpl implements SysUserService {
    @Resource
    private SysUserMapper sysUserMapper;

    /**
     * 模糊查询
     * @param sysUser
     * @return
     */
    @Transactional
    @Override
    public List<SysUser> getList(SysUser sysUser) {
        try {
            return sysUserMapper.selectSysUserList(sysUser);
        } catch (RuntimeException e) {
            e.printStackTrace();
            throw e;
        }
    }



    /**
     * 添加角色信息
     * @param sysRole
     * @return
     */
    @Transactional
    @Override
    public int add(SysRole sysRole) {
        return sysUserMapper.add(sysRole);
    }



    public void setSysUserMapper(SysUserMapper sysUserMapper) {
        this.sysUserMapper = sysUserMapper;
    }


}
